home *** CD-ROM | disk | FTP | other *** search
/ Singles Flirt Up Your Life! (German) / Singles Flirt Up Your Life.iso / data1.cab / Statemachine / questErotic1.lua < prev    next >
Text File  |  2004-01-29  |  2KB  |  80 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questErotic1 entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- on game over: relationship conditions get reset to 0 and all quests are reset to initial
  10.     onMsg("questreset", function(msg)
  11.         --getParent().getParent().getCharacter(MIKE).decRelationshipCondition(ELAINE, REL_EROTIC,1);
  12.         --getParent().getParent().getCharacter(ELAINE).decRelationshipCondition(MIKE, REL_EROTIC,1);
  13.         setState("initial");
  14.     end ) 
  15. ---------------------------------------------------------------------------------------------------------------------------------------    
  16.     
  17.     state("initial") 
  18.         onMsg("checkCondition", function(msg)
  19.             -- check if questRomance1 has already started
  20.             --if getParent().questRomance1.getState() ~= "initial" then
  21.             --    setState("done");
  22.             --end
  23.  
  24.             local mike = getParent().getParent().getCharacter(MIKE);
  25.             local elaine = getParent().getParent().getCharacter(ELAINE);
  26.  
  27.             if ( -- condition here
  28.         ----------------
  29.                 min(    mike.getRelationshipCondition(ELAINE, REL_EROTIC),
  30.                     elaine.getRelationshipCondition(MIKE, REL_EROTIC)) >= 1)
  31.         ----------------
  32.             then
  33.                 -- go to talk position
  34.                 mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine , "questErotic1");
  35.  
  36.                 setState("talktome");
  37.             end
  38.         end )
  39.         
  40.         
  41.     state("talktome")
  42.         -- as soon as arrived - start dialog (interaction.talkCutscene sends talking)
  43.         onMsg("talking", function(msg)
  44.             if ( msg.data == "questErotic1" ) then
  45.                 popupConversation("dialogErotic1");
  46.                 setState("donetalktome");
  47.             end
  48.         end )
  49.         
  50.         onMsg("talkingCancelled", function(msg)
  51.             if ( msg.data == "questErotic1" ) then
  52.                 print("--------------------> talktome onMsg talkingCancelled " .. msg.data);
  53.                 setState("done");
  54.             end
  55.         end )
  56.         
  57.     
  58.     state("donetalktome")
  59.         -- last dialog box clicked away
  60.         onMsg("yes", function(msg)
  61.             -- cancel
  62.             local mike = getParent().getParent().getCharacter(MIKE);
  63.             local elaine = getParent().getParent().getCharacter(ELAINE);
  64.  
  65.             mike.cancelCurrentActivity();
  66.             elaine.cancelCurrentActivity();
  67.             setState("done");
  68.         end )
  69.  
  70. ---------------------------------------------------------------------------------------------------------------------------------------    
  71.  
  72.         
  73.     state("done")
  74.     
  75.     -- sackgasse hier
  76.         
  77.         
  78.         
  79. endStateMachine()
  80.